#ifndef CONSULTANT_H
#define CONSULTANT_H

#include <string>
#include <sstream>

#include "rapidxml.hpp"

class Consultant{
public :
	static const std::string CONS_NODE;
	static const std::string CONS_FIRST_NAME_NODE;
	static const std::string CONS_NAME_NODE;
	static const std::string CONS_MAIL_NODE;
	static const std::string CONS_ACCOR_NODE;
	static const std::string CONS_SMOKE_NODE;

private :
	std::string* firstName;
	std::string* name;
	std::string* mail;
	std::string* accor;
	bool smoker;

public :
	Consultant(void) : firstName(0), name(0), mail(0), accor(0), smoker(false) {}
	
	Consultant(const Consultant& consultant){
		firstName = new std::string(*consultant.getFirstName());
		name = new std::string(*consultant.getName());
		mail = new std::string(*consultant.getMail());
		accor = new std::string(*consultant.getAccor());
		smoker = consultant.isSmoker();
	}
	
	Consultant(std::string _firstName, std::string _name, std::string _mail, std::string _accor, bool _smoker) {
		firstName = new std::string(_firstName);
		name = new std::string(_name);
		mail = new std::string(_mail);
		accor = new std::string(_accor);
		smoker = _smoker;
	}

	virtual ~Consultant(void){
		delete(firstName);
		delete(name);
		delete(mail);
		delete(accor);
	}

	std::string* getFirstName(void) const { return firstName; }
	std::string* getName(void) const { return name; }
	std::string* getMail(void) const { return mail; }
	std::string* getAccor(void) const { return accor; }
	bool isSmoker(void) const { return smoker; }

	void setFirstName(std::string _firstName){
		if(firstName){
			delete(firstName);
		}

		firstName = new std::string(_firstName);
	}

	void setName(std::string _name){
		if(name){
			delete(name);
		}

		name = new std::string(_name);
	}

	void setMail(std::string _mail){
		if(mail){
			delete(mail);
		}

		mail = new std::string(_mail);
	}

	void setAccor(std::string _accor){
		if(accor){
			delete(accor);
		}

		accor = new std::string(_accor);
	}

	void setSmoking(bool _smoke){
		smoker = _smoke;
	}

	rapidxml::xml_node<>* constructNode(rapidxml::xml_document<>* doc) const;
};

#endif //CONSULTANT_H